package cn.dnf.feign;

import cn.dnf.domain.Ticket;
import cn.dnf.domain.User;
import cn.dnf.fallbackFactory.MovieFallbackFactory;
import cn.dnf.util.JsonResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@FeignClient(name = "service-movie",fallbackFactory = MovieFallbackFactory.class)
@RequestMapping("/movie")
public interface MovieFeignClients {
    @RequestMapping(value ="/findById/{id}",method = RequestMethod.GET)
    Ticket findById(@PathVariable("id") Long id);

    @PostMapping("/update")
    void update(@RequestBody Ticket ticket);

    @GetMapping("/findAll")
    List<Ticket> findAll();

    @GetMapping("/watch/{id}")
    JsonResult watch(@PathVariable Long id);

    @PostMapping("/gift")
    void gift(@RequestBody User user);
}
